package cn.edu.scau.cmi.linyiling.composite.safe;

import java.util.HashSet;
import java.util.Set;

public class SafeComposite implements SafeComponent {
	private String name;
	private Set<SafeComponent> children = new HashSet<SafeComponent>();
	
	public SafeComposite(String a) {
		this.name = a;
	}
	
	@Override
	public String doSomething() {
		return this.name;
	}

	public void addChildren(SafeComponent c) {
		this.children.add(c);
	}
	
	public void delect(SafeComponent c) {
		this.children.remove(c);
	}
	
	public Set<SafeComponent> getChildren() {
		return this.children;
	}
}